<?php

namespace common\Table;

use common\Table\baseTable;

class TdSelectIdfaFromFddIosTable extends baseTable {

    private $_table = 'td_select_idfa_from_fdd_ios';

    public function insert($actColumns) {
        return $this->db->insert($actColumns, $this->_table);
    }
    
    public function selectIdfa($idfa, $appid) {
        return $this->db->selectAll('select idfa from '. $this->_table .' where idfa in('.$idfa.')');
    }
    
    public function selectIdByIdfa($idfa) {
        return $this->db->selectOne('select id from '. $this->_table .' where idfa = :idfa', array(':idfa' => $idfa));
    }
    
    public function getCount() {
        $result = $this->db->selectOne('select count(id) as count from '. $this->_table);
        
        return $result['count'];
    }
    
    public function getSelectIdfaFromFddIos($offset, $limit) {
        return $this->db->selectAll("select idfa from ". $this->_table ." limit $offset, $limit");
    }
}
